package com.bw.comtroller;

import com.bw.bean.Movie;
import com.bw.service.MovieService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MovieController {
    @Autowired
    MovieService movieService;

    @RequestMapping("/list1")
    public List list1(){
        List<Movie> list1 = movieService.getList1();
        return list1;
    }

    @RequestMapping("/list2")
    public List list2(){
        List<Movie> list2 = movieService.getList2("霸");
        return list2;
    }

    @RequestMapping("/list3")
    public List list3(){
        List<Movie> list3 = movieService.getList3("张艺谋");
        return list3;
    }

    @RequestMapping("/list4")
    public List list4(){
        List<Movie> list4 = movieService.getList4("2000","2010");
        return list4;
    }
}
